<?php
class DbTable_Pessoa extends Zend_Db_Table_Abstract
{

	protected $_name = 'pessoa';
	protected $_rowClass = 'DbRowPessoa';
	protected $_sequence = true;

	public function buscarPessoasComLimite($qtd, $inicio){
		$select = $this->select()
						->from(array('p' => 'pessoa'),
				array('cpf','nome'))
				->limit($qtd,$inicio);
				
		return $this->fetchAll($select);
	}
	
	public function buscarTotalPessoas(){
		
		$select = $this->select()	
						->from($this, array('count(*) as total'));
		return $this->fetchAll($select)->toArray();
	}
	
	public function buscarTodosOrdenadosAsc($coluna){
		$select = $this->select()
						->order(array($coluna . " ASC"));
		return $this->fetchAll($select);
		
	}
}